home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wildcat Files 2
/
The Wildcat Files 2 (Arsenal Computer).ISO
/
wccode
/
add4dos.wcc
< prev
next >
Wrap
Text File
|
1995-03-22
|
4KB
|
114 lines
'----------------------------------------------------------------------------
'
' ADD4DOS ver 1.0
' CyberDeck Systems Software
' Written by Kevin Erickson
' Fidonet 1:2613/308
'
' Released into PUBLIC DOMAIN 10/9/94 All Rights released.
'
'
' ADD4DOS is a wccode utility that will extract all the file descriptions
' for every file *not* marked as on CD-ROM and write a batch file to add
' a 4DOS descript.ion file description for that file in the directory that
' the file exists.
'
' This release is VERY slow, if you can speed it up please do. Send me a
' copy, I'd love to see how you did it.
'
' There is no warranty. If it breaks your system, it's not my fault.
'
' See bottom of source code for a list of known bugs.
'----------------------------------------------------------------------------
Dim fRec as FileRecord
dim fra as filearearecord
dim descr as string*40
'Automatically trims the description to 40 characters so it fits on one line.
dim ctr as long
dim null as string
dim i as integer
const propchars = "\|/-"
i = 1
' Sets up the spinning prompt. Remove this to speed up the program a little.
null = ""
cls
Open "c:\add4dos.bat" for output as #1
'This is the batch file it writes to and runs at the end of the program.
'
print mid(propchars, i, 1)
' Sets up the spinning prompt. Remove this to speed up the program a little.
getfileinfo(fRec, null)
'Gets the first file record.
if fRec.description = "" then
'If description is black it skips to the next file record.
getnextfile(frec)
end if
Do
if (fRec.Description) <> "" then
'If description is black it skips to the next file record.
if fRec.Flags = 0x0010 then
' If this file has the the 'FILE IS ON CD-ROM' flag set it is skipped
locate 1,1
else
locate 1,1
Print "Please wait. . . ";
locate 1, 18
i = (i mod len(propchars)) + 1
print chr(8); mid(propchars, i, 1);
' The spinning prompt. Remove this to speed up the program a little.
' Be sure to check the program flow through the if...thens if you do...
getfilearea(fra, frec.area)
' Gets the path to the current file
descr = frec.description
print #1, "describe ";fra.path;frec.name;" ";chr(34);descr;chr(34)
' Writes to the ADD4DOS.BAT file
end if
end if
Loop until not(getnextfile(frec))
' Loops until the last file record
close #1
shell("c:\add4dos.bat", "c:\")
'Shells out and runs the .bat file. Comment this out and run from DOS for
'faster results
kill "c:\add4dos.bat"
'Deletes the .BAT file after execution. (Mine was 186k) <grin>
end
'-----------------------------------------------------------------------------
' Known Bugs and/or non-fatal problems
'
' ■ If a Wildcat file description has quotes in it, it makes the 4DOS
' describe command skip the description.
'
' ■ If you have files on a CD-ROM, but not marked that way in the data base
' then 4DOS will try to write a DESCRIPT.ION file to the CD. A critial
' error message is generated.
'
' ■ Batch file running is very slow, if you have a bat2exe program add it
' to the shell to compile the batch file before execution.
'-----------------------------------------------------------------------------
'-----------------------------------------------------------------------------
' Future plans
'
' ■ I am planning on adding the ability to update new files in the upload
' directory only, that way it can be run as a short event each day after
' the inital run through the entire databse.
'
'-----------------------------------------------------------------------------